package com.weishu.mapper;

import com.weishu.domain.Users;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UsersMapper {

    List<Users> list(Users sysUser);

    //添加
    @Insert("insert into users(username,`password`,email,address,fax,mobile,landline_number,remark,deptid,province,city,country,`status`) \n" +
            "value(#{username},#{password},#{email},#{address},#{fax},#{mobile},#{landlinenumber},#{remark},#{deptid},#{province},#{city},#{country},#{status})")
    boolean add(Users sysUser);

    //删除
    @Delete("delete from users where userid=#{userid}")
        boolean del(Integer userid);

    //修改
    @Update("update users set username=#{username},password=#{password},email=#{email},address=#{address},fax=#{fax},mobile=#{mobile},landline_number=#{landlinenumber},remark=#{remark},deptid=#{deptid},province=#{province},city=#{city},country=#{country},status=#{status} where userid=#{userid}")
    boolean update(Users sysUser);

    @Select("select userid,username from users")
    List<Users> getUser();
}
